<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
        xmlns:icecore="http://www.icefaces.org/icefaces/core"
       xmlns:ace="http://www.icefaces.org/icefaces/components"
       xmlns:ice="http://www.icesoft.com/icefaces/component"
       xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:head>
        <title><h:form><h:outputText>Mails anzeigen</h:outputText></h:form></title>
    </h:head>
    <h:body>
        <ui:composition template="WEB-INF/templates/lecture.xhtml">
            <ui:define name="content">          
                    <ice:dataTable value="#{showMailsBean.mails}"
                                   var="m">
                        <ice:column>
                            <f:facet name="header"><ice:outputText value="Von" /></f:facet>
                            <ice:outputText value="#{m.mail.from.username}" />
                        </ice:column>
                        
                        <ice:column>
                            <f:facet name="header"><ice:outputText value="An" /></f:facet>
                            <ice:outputText value="#{m.mail.to}" />
                        </ice:column>
                        
                        <ice:column>
                            <f:facet name="header"><ice:outputText value="Betreff" /></f:facet>
                            <ice:outputText value="#{m.mail.subject}" />
                        </ice:column>
                        
                        <ice:column>
                            <f:facet name="header"><ice:outputText value="Datum" /></f:facet>
                            <ice:outputText value="#{m.mail.mailDate}" />
                        </ice:column>
                        
                        <ice:column>
                            <f:facet name="header"><ice:outputText value="Text" /></f:facet>
                            <ice:form>
                                <ice:outputText value="#{m.mail.msg}"
                                                rendered="#{m.showMsg}"/>
                                <ice:commandLink value="anzeigen"
                                                 rendered="#{!m.showMsg}"
                                                 action="#{m.toggle()}" />
                                <ice:commandLink value="verberger"
                                                 rendered="#{m.showMsg}"
                                                 action="#{m.toggle()}" />
                            </ice:form>                                
                        </ice:column>
                        
                    </ice:dataTable>
            </ui:define>
        </ui:composition>
    </h:body>
</html>
